<template>
  <el-time-picker
      ref="elTimePicker"
      v-bind="$attrs"
      v-on="$listeners"
      v-model="val"
      type="date"
      :value-format="valueFormat"
      :size="preferences.FormSize"
      :placeholder="placeholder">
    <template v-for="(index, name) in $slots" :slot="name">
      <slot :name="name"></slot>
    </template>
  </el-time-picker>
</template>

<script>
export default {
  name: "MTimePicker",
  data() {
    return {
      val: ''
    }
  },
  model:{
    prop: 'value'
  },
  props: {
    'value': {
      type: [Date, String, Number, Array],
    },
    placeholder:{
      type: String,
      default: '选择时间'
    },
    valueFormat:{
      type: [String, Number],
      default: 'timestamp'
    }
  },
  components: {},
  watch:{
    value:{
      handler(e){
        this.val = e
      },
      immediate: true
    }
  },
  mounted() {
  },
  methods: {
    focus(){
      this.$refs.elTimePicker.focus(...arguments)
    },
  }
}
</script>

<style lang="scss" scoped>

</style>
